//
//  StartupAnimation.m
//  UCiEnabler
//
//  Created by Delio Brignoli on 10/09/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "StartupAnimation.h"


@implementation StartupAnimation


- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // Initialization code
    }
    return self;
}

- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
	UIImageView *splashView = self;
	[splashView removeFromSuperview];
	[splashView release];
}

- (void)didMoveToSuperview {
	UIImageView *splashView = self;
	UIView *window = self.superview;
	if (window != nil) {
		self.image = [UIImage imageNamed:@"Default.png"];
		[window bringSubviewToFront:splashView];
		[UIView beginAnimations:nil context:nil];
		[UIView setAnimationDuration:0.5];
		[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];
		[UIView setAnimationDelegate:self];
		[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
		splashView.alpha = 0.0;
		splashView.frame = CGRectMake(-60, -60, 440, 600);
		[UIView commitAnimations];
	}
}

- (void)dealloc {
    [super dealloc];
}


@end
